package ch03.test;

import ch03.test.dao.CountDao;
import ch03.test.factory.CountDaoFactory;
import ch03.test.service.CountService;
import ch03.test.service.impl.CountServiceImpl;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner input=new Scanner(System.in);
        System.out.println("请输入运算符:");
        String op=input.next();
        CountDao countDao = CountDaoFactory.getInstance(op);
        CountServiceImpl service=new CountServiceImpl();
        service.setCountDao(countDao);
        int calculate = service.calculate(10, 20);
        System.out.println(calculate);
    }
}
